package homework1;


import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {

        // 方式1，使用xml配置
//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContext.xml");
//        Student bean = (Student) context.getBean("student");
//        System.out.println(bean);

        // 方式2，使用注解
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Person.class);
        Person person = (Person) context.getBean("person");
        System.out.println(person);
    }

}
